//
//  NSData+Category.m
//  Project_Demo
//
//  Created by caoxiaozhu on 2018/7/4.
//  Copyright © 2018年 caoxiaozhu. All rights reserved.
//

#import "NSData+Category.h"

@implementation NSData (Category)

- (NSString *)base64Encoding
{
    NSString *result = nil;
    result = [self base64EncodedStringWithOptions:0];
    return result;
}

+ (NSString *)base64Encoding:(NSData*)data
{
    NSString *result = nil;
    result = [data base64EncodedStringWithOptions:0];
    return result;
}

- (NSString *)toString {
    return [[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding];
}

+ (NSString *)toString:(NSData *)data {
    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}

@end
